#!/bin/bash

# Redis-rs2 集群重启脚本

set -e

# 颜色定义
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color

echo -e "${CYAN}🔄 Redis-rs2 集群重启脚本${NC}"
echo -e "${CYAN}============================${NC}"
echo

echo -e "${BLUE}步骤1: 停止当前集群${NC}"
./scripts/stop_cluster.sh

echo
echo -e "${BLUE}步骤2: 等待资源释放${NC}"
echo -e "${YELLOW}⏳ 等待5秒确保所有资源释放...${NC}"
sleep 5

echo
echo -e "${BLUE}步骤3: 启动集群${NC}"
./scripts/start_cluster.sh

echo
echo -e "${GREEN}🎉 集群重启完成！${NC}"